#ifndef GENIE_V_FAULTS
#define GENIE_V_FAULTS

#define FAULT_DOT_SOLID                 0x0080 // on ecu display
#define FAULT_DOT_SOLID_PL              0x0100 // on old platfom controls fault led

// Flag to mark this fault as originating from the motor controller.
#define MOTOR_FAULT_FLAG          0x1000


#define FAULT_INTERNAL_ECU          ( 0x01 | 0x80 | 0x100) // set only on init
#define FAULT_COM_ERROR             ( 0x02 | 0x80 | 0x100) // no communication to platform
#define FAULT_GPS_COM_ERROR            0x09
#define FAULT_GPS_ERROR                34 //( 0x09 | 0x80 | 0x100) // no communication to GPS
#define FAULT_DIPSWITCH_ERROR       ( 0x03 | 0x80 | 0x100) // the bit 0 is set to a1
#define FAULT_CHASSIS_UP_SWITCH        ( 12   | 0x80 )
#define FAULT_CHASSIS_DOWN_SWITCH      ( 12   | 0x80 )
#define FAULT_OUTDOOR_MODE             13
//#define FAULT_FREEWHEEL_SWITCH    ( 11   | 0x80 )
#define FAULT_POTHOLE_GUARD_FAILURE    ( 18   | 0x80 )
#define FAULT_OUTDOOR_LS_FAILURE        19
#define FAULT_PRESSURE_INPUT        ( 31   | 0x80 | 0x100)
#define FAULT_ANGLE_INPUT           ( 32   | 0x80 | 0x100)
//#define FAULT_MODE_SWITCH_FAILURE       34
#define FAULT_PRESSURE_INPUT2       35

#define FAULT_LOW_BATTERY_ALERT         36
#define FAULT_LOW_BATTERY_SHUTDOWN      37

#define FAULT_JOYSTICK_LEFT_SWITCH      42
#define FAULT_JOYSTICK_RIGHT_SWITCH     43
#define FAULT_JOYSTICK_ENABLE_SWITCH   ( 46 | 0x80 | 0x100)
//#define FAULT_PLATFORM_MISMATCH_MODE   FAULT_JOYSTICK_ENABLE_SWITCH
#define FAULT_JOYSTICK_OUT_OF_NEUTRAL  ( 47 | 0x80)
//#define FAULT_LIFT_ENABLE_SWITCH       ( 45 | 0x80 | 0x100)
//#define FAULT_ROCKER_OUT_OF_NEUTRAL    ( 48 | 0x80)

//Rick add @20151105 from 48 to 51
#define FAULT_HORN_COIL                 48
#define FAULT_METER_COIL                49
#define FAULT_LED_COIL                  50
#define FAULT_SPARE_COIL                51

#define FAULT_FORWARD_COIL              52
#define FAULT_REVERSE_COIL              53
#define FAULT_UP_COIL                   54
#define FAULT_DOWN_COIL                 55

#define FAULT_RIGHT_COIL                56
#define FAULT_LEFT_COIL                 57
#define FAULT_BRAKE_COIL                58
#define FAULT_MCE_COIL                  59

#define FAULT_MOTOR_CTLR                60
#define FAULT_MC_CURRENT_SENSOR         61
#define FAULT_HARDWARE_FAILSAFE         62
#define FAULT_MOTOR_SHORT               63
#define FAULT_MC_SRO                    64
#define FAULT_MC_THROTTLE               65
#define FAULT_EMER_REVERSE              66
#define FAULT_HPD                       67
#define FAULT_HIGH_NEUTRAL_CURRENT      69  // ZAPI 53 = "Stby I High "
#define FAULT_STEERING_INPUT_RANGE      70  // ZAPI 84 = "Steer Sensor KO "
#define FAULT_MAIN_CONTACTOR            71
#define FAULT_OVER_VOLTAGE              72
#define FAULT_THERMAL_CUTBACK           73
#define FAULT_OVERHEATED_MOTOR          74

#define FAULT_PUMP_MOTOR                75
#define FAULT_LEFT_MOTOR                76
#define FAULT_RIGHT_MOTOR               77

#define FAULT_PUMP_MOTOR_SHORT          78
#define FAULT_LEFT_MOTOR_SHORT          79
#define FAULT_RIGHT_MOTOR_SHORT         81

#define FAULT_LEFT_BRAKE_COIL           82
#define FAULT_RIGHT_BRAKE_COIL          83
#define FAULT_MOTOR_POST_SHORTED        84

#define FAULT_BRAKE_RELEASE_SWITCH_ON   85
#define FAULT_BRAKE_RELEASE_NOT_SHOWED  86
#define FAULT_BRAKE_RELEASE_NEED_SWITCH_ON  87

#define FAULT_MOTOT_FIELD_OPEN          89
#define FAULT_LEFT_MOTOR_FIELD_SHORT    91
#define FAULT_RIGHT_MOTOR_FIELD_SHORT   92

#define FAULT_LOW_VOLTAGE              ( 68 | 0x80 | 0x100)  // battery below 9 volts

#define FAULT_OVERLOAD                  ( 0x80 | 0x100)
#define FAULT_OFF_LEVEL                 ( 0 )

#endif
